package com.wokeMy.view;

import android.content.Intent;
import android.view.View;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.wokeMy.view.adpter.OpenbusinessAdapter;
import com.wokeMy.view.base.BaseActivity;
import com.zhongcai.online.R;

import java.util.List;

public class OpenBusinessActivity extends BaseActivity {

    ImageView back_openbusine_iv;
    ListView tijiao_openbusine_tv;
    TextView  title_openbusine_tv;

    OpenbusinessAdapter openbusinessAdapter;
    List<String> data;
    Intent intent;
    String passway;
    float money;
    @Override
    public void setContentView() {
        setContentView(R.layout.activity_open_business);
    }

    @Override
    public void initActivity() {
        View headView=View.inflate(this,R.layout.head_item_openbusiness_lv,null);
        TextView passwayTV=(TextView)headView.findViewById(R.id.pass_head_item_openbus_tv);
        TextView moneyTv=(TextView)headView.findViewById(R.id.content_item_openbus_tv);
        passwayTV.setText(passway);
        moneyTv.setText(money+"");
        tijiao_openbusine_tv.addHeaderView(headView);
        tijiao_openbusine_tv.setAdapter(openbusinessAdapter);
        back_openbusine_iv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    public void initView() {
        back_openbusine_iv = myFindViewById(R.id.back_openbusine_iv);
        title_openbusine_tv = myFindViewById(R.id.title_openbusine_tv);
        tijiao_openbusine_tv = myFindViewById(R.id.tijiao_openbusine_tv);
    }

    @Override
    public void initData() {
        intent=getIntent();
        data=intent.getStringArrayListExtra("nocarpay");
        money=intent.getFloatExtra("money",0.0f);
        passway=intent.getStringExtra("passway");
        openbusinessAdapter = new OpenbusinessAdapter(this,data);
    }
}
